
function setupWebViewJavascriptBridge(callback) {
    if (window.WebViewJavascriptBridge) {
        return callback(WebViewJavascriptBridge);
    }
    if (window.WVJBCallbacks) {
        return window.WVJBCallbacks.push(callback);
    }
    window.WVJBCallbacks = [callback];
    var WVJBIframe = document.createElement('iframe');
    WVJBIframe.style.display = 'none';
    WVJBIframe.src = 'qmmwvjbscheme://__BRIDGE_LOADED__';
    document.documentElement.appendChild(WVJBIframe);
    setTimeout(function () {
        document.documentElement.removeChild(WVJBIframe);
    },
        0
    );
}

setupWebViewJavascriptBridge(function (bridge) {

});

window.JSBridge = {
    call: function (host, method, params, callBack) {
        WebViewJavascriptBridge.callHandler('callActionFromJsBridge', { 'host': host, 'method': method, 'params': params }, callBack);
    }
};
